<!DOCTYPE html>
<html lang="en">

<head>
    <{include file="public_html/header_tag.html" }>
        <title>在线支付</title>

</head>

<body>
    <div class="wrap">
        <!--star header-->
        <div class="header">
            <{include file="public_html/header_menu.html" }>
        </div>
        <!--end  header-->

        <div class="return_nav">
            <div class="w1200 line-bottom">
                您的位置：<a href="/">首页</a><span>&gt;</span><em>在线支付</em>
            </div>
        </div>
        <!--star main-->
        <div class="wrap_main fix">
            <!--content star-->
            <div class="col_main">
                <!--star在线支付-->
                <div class="box_item m-t30 tijiaoLC">

                    <div style="background-color: #F7F7F7; border-top: 1px solid #D3D3D3; border-bottom: 1px solid #D3D3D3; padding: 10px 20px; line-height: 26px; clear: both;">
                            <div style="display: inline-block; width: 70%;">
                                <input type="hidden" id="order_no" value="<{$order_data['order_id']}>">
                                <div>订单编号：<{$order_data['order_num']}></div>
                                <div>订单描述：<{$seo}></div>
                            </div>
                            <div style="display: inline-block;">应付金额：<span style="font-size: 16px;font-weight: bold;">￥<{$order_data['total_product_amount']}></span></div>
                        </div>
                        <div style="pborder: 1px solid #d3d3d3;margin: 20px 20px 0;padding: 10px;border: 1px solid #d3d3d3;background: url(/application/web/views/user_center/skin/images/WePayLogo.png) no-repeat 10px center / 100px auto;">
                            <div style="background: url(/application/web/views/user_center/skin/images/WePaytj.png) no-repeat scroll 10px center / 40px auto;margin-left: 90px;padding-left: 70px;color: #bbb;display: inline-block;">
                                亿万用户的选择，更快更安全
                            </div>
                            <div style="display: inline-block;float: right;">支付 <span style="color:#ff5215">￥<{$order_data['total_order_amount']}></span></div>
                        </div>
                        <div style="margin: 20px 0;text-align: center;">
                            <{if $result['status'] == 0}>
                                <div><img alt="微信扫码支付" src="/order/wx_create_pay_qrcode?data=<{urlencode($result['code_url'])}>" style="width:260px;"/></div>
                                <div style="color: #999; padding-top: 10px;">温馨提示：支付后，页面长时间无反应，请刷新页面！</div>
                                <!-- <div><img src="/static/www/img/WePaytext.png" style="width:200px;" /></div> -->
                            <{else}>
                                <div>
                                    提示：<!--代码：<{$result['msg_code']}>，描述：--><{$result['msg_des']}>
                                    <!-- 如无跳转，<a href="/user_center/recharge" class="a_btn c-3b9eeb">请点击这里！</a> -->
                                </div>
                            <{/if}>
                        </div>

                    <div class="fix tar p-tb10">
                        <div style="padding-right:50px;">
                            <span><a class="c-666666" href="#">支付有问题？</a></span>
                            <!-- <span class="p-lr5"><a class="c-1aa3fa" href="#">查看帮助</a></span> -->
                            <span><a class="c-666666" href="#">请拨打客服热线 <{$school_info.link_tel}></a></span>
                        </div>
                    </div>

                </div>
                <!--end在线支付-->
                <div class="fix" style="height:90px;"></div>

            </div>
            <!--content end-->
        </div>
        <!--end  main-->
        <!--star  footer-->
        <div class="footer b-FFFFFF">
            <{include file="public_html/footer.html" }>
        </div>
        <!--end  footer-->
    </div>
    <script type="text/javascript">
    // 每秒请求一次数据，然后判断，跳转，增加用户友好性
    var order_no = $('#order_no').val();
    var start = window.setInterval("checkstatus(order_no)", 5000);
    var cycles = 60;

    function checkstatus(order_no) {
        if (cycles == 0) {
            window.clearInterval(start);
            return false;
        }

        if(order_no == undefined || order_no == '') {
            window.clearInterval(start);
        } else {
            $.ajax({
                url:"/order/check_order_status",
                async: false,
                type:'POST',
                dataType:'json',
                data:{order_no : order_no},
                success:function(msg){
                    if(msg.status == 0) {
                        if (msg.order.trade_state == 'SUCCESS') {
                            window.clearInterval(start);
                            window.location.href = "/order/pay_success/"+order_no;
                        }
                    }
                }
            });
        }

        cycles--;
    }
    </script>
</body>

</html>